<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box {
            width: 100px;
            height: 100px;
            background-color: #f00;
        }

        .blue {
            background-color: #00f;
        }
    </style>
</head>
<body>
    <div id="app">
        <button @click="show = !show">切换显示/隐藏</button>
        <div v-show="show" class="box"></div>
        <div v-if="show" class="box blue"></div>

        <div>
            <h2 v-if="age >= 18">去网吧偷耳机</h2>
            <h2 v-else>去公园捡垃圾</h2>
        </div>

        <div>
            <div v-if="money >= 2000">请我去按摩</div>
            <div v-else-if="money >= 1000">请我去洗脚</div>
            <div v-else-if="money >= 500">请我去吃饭</div>
            <div v-else>打他一顿，让他回家找他宝贝要钱钱</div>
        </div>
    </div>

    <script src="./vue.js"></script>
    <script>
        new Vue({
            el: '#app',
            data: {
                show: true,
                age: 16,
                money: 2300
            }
        })
    </script>
</body>
</html>